package top.rainf.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.vo.UserPersonalInfo;
import top.rainf.mapper.UserPersonalInfoMapper;
import top.rainf.service.IUserPersonalInfoService;

import java.util.List;

/**
 * @author 星环
 * @date Wed May 10 21:04:42 CST 2023
 * @description UserPersonalInfo服务的实现类
 */
@Service
public class UserPersonalInfoService implements IUserPersonalInfoService {

    @Autowired
    UserPersonalInfoMapper userPersonalInfoMapper;

    @Override
    public List<UserPersonalInfo> getUserPersonalInfoList() {
        return userPersonalInfoMapper.selectAll();
    }



    @Override
    public UserPersonalInfo getOneById(int id) {
        return userPersonalInfoMapper.selectById(id);
    }

    @Override
    public boolean deleteOneById(int id) {
        return userPersonalInfoMapper.deleteById(id) == 1;
    }

    @Override
    public boolean deleteAll(List<Integer> idList) {
        return userPersonalInfoMapper.deleteByIds(idList) == idList.size();
    }

    @Override
    public boolean updateById(UserPersonalInfo userPersonalInfo) {
        return userPersonalInfoMapper.updateById(userPersonalInfo) == 1;
    }

    @Override
    public List<UserPersonalInfo> getByIds(List<Integer> uidList) {
        return userPersonalInfoMapper.selectByIds(uidList);
    }

    @Override
    public UserPersonalInfo getJoinedInfo(Integer id) {
        return userPersonalInfoMapper.selectJoinedInfoById(id);
    }
}
